package com.mocha.common.kits;

import cn.hutool.core.util.StrUtil;

import java.util.HashSet;
import java.util.Set;

/**
 * @author: songkui
 * @date: 2022/3/18 10:34
 */
public class StringKits extends StrUtil {

    public static Set<String> toSet(String str, String regex){
        if (isEmpty(str)){
            return null;
        }
        String[] strings =  str.split(regex);
        Set<String> set = new HashSet<>(MapKits.mapSize(strings.length));
        for (String s : strings){
            set.add(s);
        }
        return set;
    }

    public static void main(String[] args) {
        System.out.println(t());
    }

    public static int t(){
        try {
            int a = 1/0;
            return a;
        } catch (Exception e) {
           return 10;
        } finally {
            int c = 1/0;
            System.out.println("xxxxxxxx");
//            return 20;
        }
    }


}
